package com.yunhe.fountain.constant;

/**
 * @ClassName CommandConstant
 * @Description TODO
 * @Author HeTao
 * @Date 2021/7/8 9:04
 * @Version 1.0
 **/
public class FountainConstant {

    public enum COMMAND_CONSTANT {
        Stop("0000", "停止节目"),
        StartFirstProgram("0100", "开始第一个节目"),
        StartSecondProgram("0101", "开始第二个节目"),
        StartThirdProgram("0102", "开始第三个节目"),
        StartFourthProgram("0103", "开始第四个节目"),
        StartFifthProgram("0104", "开始第五个节目"),
        carryOn("0200", "继续"),
        selectStatus("0300", "查询状态"),;
        private String value;
        private String title;
        COMMAND_CONSTANT(String value, String title) {
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }

        public static String getTitle(String value) {
            COMMAND_CONSTANT[] values = values();
            for (COMMAND_CONSTANT officeStatusCode : values) {
                if(officeStatusCode.value().equals(value)){
                    return officeStatusCode.title();
                }
            }
            return null;
        }
    }

    public enum RESULT_SUCCESS_CONSTANT {
        ConnectionSuccess("connection_success", "连接成功"),
        CarryOnSuccess("carry_on_success", "继续成功"),
        StopSuccess("stop_success", "停止成功"),
        StartProgramSuccess("start_program_success", "开启节目成功"),
        IssueOrderSuccess("issue_order_success", "下发指令成功"),;
        private String value;
        private String title;
        RESULT_SUCCESS_CONSTANT(String value, String title) {
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }

        public static String getTitle(String value) {
            RESULT_SUCCESS_CONSTANT[] values = values();
            for (RESULT_SUCCESS_CONSTANT resultCode : values) {
                if(resultCode.value().equals(value)){
                    return resultCode.title();
                }
            }
            return "";
        }
    }

    public enum RESULT_FAIL_CONSTANT {
        ConnectionFail("connection_fail", "建立连接失败"),
        CarryOnFail("carry_on_fail", "继续失败"),
        StopFail("stop_fail", "停止失败"),
        StartProgramFail("start_program_fail", "开启节目失败"),
        IssueOrderFail("issue_order_fail", "下发指令失败"),;
        private String value;
        private String title;
        RESULT_FAIL_CONSTANT(String value, String title) {
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }

        public static String getTitle(String value) {
            RESULT_FAIL_CONSTANT[] values = values();
            for (RESULT_FAIL_CONSTANT resultCode : values) {
                if(resultCode.value().equals(value)){
                    return resultCode.title();
                }
            }
            return "";
        }
    }
}
